<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]-->
    <script type="text/javascript" src="../../../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../../../lib/respond.min.js?rev=@@hash"></script>
    <!--[endif]-->
    <link rel="stylesheet" type="text/css" href="../../../../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../../../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../../../../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../../../../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../../../../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../../../ht-css/Project.css" />
    <link rel="stylesheet" type="text/css" href="../../../../ht-css/style-q.css" />
    <!--[if IE 6]-->
    <script type="text/javascript" src="../../../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <!--[endif]-->
    <title>编辑安卓补丁包</title>
</head>
<body>
<nav class="breadcrumb">首页 <span class="c-gray en">&gt;移动端管理 <span class="c-gray en">&gt;</span> <span onclick="returnVer()" style="cursor: pointer">安卓补丁包管理</span><span class="c-gray en">&gt;</span> 编辑<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px ;display:block" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
    <form class="ml-20 mr-20" id="appVersionForm"  method="post">
        <div class="bk-gray bg-1 pd-20 text-c">
            <div class="mt-10 text-r" style="padding-right:65px">
           <!-- <input type="button" style="display: none" class="btn radius size-S ml-10 sees" value="返回" onclick="closeRecord()">-->
            </div>
            <table class="table mt-10 col-2-1" style="margin-left: 35%">
                <tbody>
                <tr>
                    <td>
                        <div>
                            <label class="form-label f-l w-85 text-r lh-26"><em class="c-red mr-5">*</em>补丁版本号：</label>
                            <span class="f-l ml-10" id="patchVersionCode" style="margin-top: 3px;"></span>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div>
                            <label class="form-label f-l w-85 text-r lh-26"><em class="c-red mr-5">*</em>压缩包名称：</label>
                            <span class="f-l ml-10" id="patchVersionName" style="margin-top: 3px;"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div >
                            <label class="form-label f-l w-85 text-r lh-26"><em class="c-red mr-5">*</em>APP版本号：</label>
                           <span><input type="radio" class="f-l  ml-10" value="" checked id="appVersionCoderadio" style="margin-top: 4px;display: none"><span class="f-l " id="appVersionCode"></span></span>
                        </div>
                    </td>
                </tr>
                <tr>
                <tr>
                    <td>
                        <div style="width: 642px;">
                            <label class="form-label f-l w-85 text-r lh-26"><em class="c-red mr-5">*</em>更新内容：</label>
                            <textarea style="width: 539px;" class="textarea"  id="content"  placeholder="请填写内容.." oninput="this.value = this.value.substring(0,200)" ></textarea><br>
                            <span style="margin-left: -350px;">注：最多200个字符</span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div>
                            <label class="form-label f-l w-85 text-r lh-30" style="height:26px"><em class="c-red mr-5">*</em>状态：</label>
                            <span class="select-box size-M ml-10 f-l" style="width:40%">
                                    <select class="select" name="isOn" id="status">
                                        <option value="">请选择</option>
                                        <option value="10">开启</option>
                                        <option value="20">关闭</option>
                                    </select>
                                </span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div>
                            <label class="form-label f-l w-85 text-r lh-26"><em class="c-red mr-5">*</em>上传补丁包：</label>
                            <img class="f-l ml-10" style="width: 50px;height: 50px;display: none" id="filePathsrc" src="../../../../img/favicon.ico">
                            <span style="margin-top: 18px;display: none" id="filePathnames" class="f-l ml-10">(<span id="filePathname"></span>)</span><br>

                        </div>
                    </td>

                </tr>
                <tr>
                    <td>
                        <span style="margin-left: -309px;" id="filePathtime"></span>
                    </td>
                </tr>
                </tbody>
            </table>

            <div class="text-c mt-10">
                <input type="button" style="display: none" class="btn btn-secondary radius size-S  edits" value="确认" onclick="save()">
                <input type="button" style="display: none" class="btn radius size-S ml-10 edits" value="取消" onclick="returnVer()">
            </div>
        </div>
    </form>


</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../../../ht-js/frame/doT.min.js?rev=@@hash"></script>
<script src="../../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../../../ht-js/Project.js?rev=@@hash"></script>
<script src="../../../../ht-js/operation-js/operation_activity/activity_login.js?rev=@@hash"></script>
<script src="../../../../ht-js/contract/jquery-form.js?rev=@@hash"></script>

<link type="text/css" rel="stylesheet" href="../../../../ht-js/operation-js/time-js/jedate.css">
<script type="text/javascript" src="../../../../ht-js/operation-js/time-js/jquery.jedate.js?rev=@@hash"></script>
<script>
    //编辑详情
    update()
    function update() {
        if(sessionStorage.getItem("patchpackname")=="编辑"){
            $(".edits").css({
                display: "inline"
            });
            $(".sees").css({
                display: "none"
            });
        }else {
            $(".sees").css({
                display: "inline"
            });
            $(".edits").css({
                display: "none"
            });
        }
        $.ajax({
            url: root.appversioncontrol.appversioncontrolinfo,
            cache: false,  //禁用缓存
            type: "GET",
            dataType: "json",
            async:false,//优先运行
            data: {
                "id": sessionStorage.getItem("Id")
            },
            success: function(data){
                if (data.errorCode == 0){
                    if(data.data!=null &&data.data!=""){
                    $("#patchVersionCode").html(data.data.patchVersionCode)
                    $("#patchVersionName").html(data.data.patchVersionName)
                    $("#appVersionCoderadio").css({
                        display: "inline"
                    });
                    $("#appVersionCoderadio").val(data.data.appVersionCode)
                    $("#appVersionCode").html(data.data.appVersionCode)
                        if(sessionStorage.getItem("patchpackname")=="编辑"){
                            $("#content").val(data.data.content)
                            $("#status").val(data.data.status)
                        }else {
                            $("#content").val(data.data.content)
                            $("#status").val(data.data.status)
                            $("#content").attr("readonly", "readonly");
                            $("#status").attr("disabled", "disabled");
                        }

                    $("#filePathsrc").css({
                        display: "inline"
                    });
                   /* $("#filePathsrc").attr("src",data.data.filePath)*/
                    $("#filePathnames").css({
                        display: "inline"
                    });
                    $("#filePathname").html(data.data.fileName)
                    $("#filePathtime").html(data.data.createTime)
                    }
                }else {
                    layer.msg(data.sub_msg, {icon: 5,time:2000});
                }
            },
            error:function(data){
                layer.msg(data, {icon: 5,time:2000});
            }
        });
    }



    function returnVer(){
        layer.confirm('确认要取消吗？', {
            btn : [ '确定', '取消' ]//按钮
        }, function() {
            window.parent.search();
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });
    }




    //提交当前版本信息
    function save(){

        if($("#content").val()==""){
            layer.msg('请输入内容！', {icon: 5,time:2000});
            return;
        }
        if($("#status").val()==""){
            layer.msg('请选择状态！', {icon: 5,time:2000});
            return;
        }

        $.ajax({
            url: root.appversioncontrol.appversioncontrolupdate,
            cache: false,  //禁用缓存
            type: "POST",
            dataType:'json',
            contentType: "application/json",
            data: JSON.stringify({
                "id":sessionStorage.getItem("Id"),
                "content": $("#content").val(),
                "status": $("#status").val(),

            }),
            success: function(data){
                if (data.errorCode == 0){
                    layer.msg("编辑成功",{icon: 1,time:2000},function () {
                        setTimeout(function () {
                            window.parent.search();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        })
                    });
                }else {
                    layer.msg(data.msg, {icon: 5,time:2000});
                }
            },
            error:function(data){
                layer.msg(data, {icon: 5,time:2000});
            }
        });



    }
    //更新内容限制字符
    var len
    var Preser
    var common=200//要限制输入的字数
    function checkMaxIut(me) {
        var text=$(me).val()
        strlen(text)
        if(len>common){
            $(me).val(Preser)
        }else {
            Preser=$(me).val()
        }
    }
    function strlen(str){
        len = 0;
        for (var i=0; i<str.length; i++) {
            var c = str.charCodeAt(i);
            //单字节加1
            if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) {
                len++;
            } else {
                len+=2;
            }
        }
        return len;
    }
//返回
    function closeRecord() {
        window.parent.seeUpload();
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    }
</script>
</body>
</html>